#include "mydialog.h"
#include "ui_mydialog.h"

#include <QHostInfo>
#include <QNetworkInterface>

const int defaultPort = 55555;

MyDialog::MyDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::MyDialog)
{
    ui->setupUi(this);

    foreach (const QHostAddress &address, QNetworkInterface::allAddresses()) {
        if (address.protocol() == QAbstractSocket::IPv4Protocol && address != QHostAddress(QHostAddress::LocalHost))
        {
            ui->ipLabel->setText(address.toString());
            break;
        }
    }
}

MyDialog::~MyDialog()
{
    delete ui;
}
